package com.studyroom.controller;

import com.studyroom.dto.Result;
import com.studyroom.service.ContactService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping("/contact")
public class ContactController {
    @Autowired
    private ContactService contactService;
    @PostMapping("/sendRequest")
    public Result sendRequest(@RequestParam Long id){
        return contactService.sendRequest(id);
    }
    @PostMapping("/getRequest")
    public Result getRequest(){
        return contactService.getRequest();
    }
    @PostMapping("/consentRequest")
    public Result consentRequest(@RequestParam Long id){
        return contactService.consentRequest(id);
    }
    @PostMapping("/disagreeRequest")
    public Result disagreeRequest(@RequestParam Long id){
        return contactService.disagreeRequest(id);
    }
    @PostMapping("/getAll")
    public Result getAll(){
        return contactService.getAll();
    }
}
